package Pattern.FactoryPattern.Car;


/**
 * @Author MJS
 * @Date 2021/8/4 11:28
 * @Description
 * 奔驰工厂  覆盖所有奔驰车型的构造方法
 */
public class BenzFactory extends AbstractFactory {
    public Car getCar(String type) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Class<?> cl = Class.forName(type);
        return (BenzCar)cl.newInstance();

    }
}
